<?php

class DataGrabber_Grabs extends Zend_Db_Table_Abstract 
{
    protected $_name = 'datagrabber_grabs';
    protected $_rowClass = 'DataGrabber_GrabRow';
    
    public static function getById($id)
    {   
        // Raid id must be numeric
        if (!is_numeric($id)) {
            return null;
        }
        
        // Create static self
        $table = new self();
        
        // Create a select for getting the raid
        $select = $table->select()->where("id = ?", $id);
        $grab = $table->fetchRow($select);
        
        // Return the raid or null
        if ($grab) {
            return $grab;
        } else {
            return null;
        }
    }
}